package com.uzai.console.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 账单下载平台
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum OrderPullPlatformEnum {

    //订单下载平台
    TBWQ("tbwq","淘宝维权订单"),

    TB("tb","淘宝订单"),

    ;

    private String key;
    private String desc;

    OrderPullPlatformEnum(String key, String desc) {
        this.key = key;
        this.desc = desc;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static OrderPullPlatformEnum getByKey(String key) {
        if (StringUtils.isBlank(key)) {
            return null;
        }
        for (OrderPullPlatformEnum type: OrderPullPlatformEnum.values()) {
            if (type.getKey().equals(key)) {
                return type;
            }
        }
        return null;
    }
}
